<?php
/**
 * User: Tony Chen
 * Date: 2017/7/23.
 */

define('ROOT_PATH', $_SERVER['DOCUMENT_ROOT']);
include ROOT_PATH . '/utils/Mysql.php';

$post = $_POST;

$mysqli = new Mysql('127.0.0.1', 'root', '123456', 'cms');

//var_dump("INSERT INTO user (username, password, create_time) VALUE ('{$num}', '{$num}', 'sssss')");
$sql = sprintf("INSERT INTO user (username, password, create_time) VALUE ('%s', '%s', '%s')", $post['username'], md5($post['password']), date('Y-m-d H:i:s'));
$ret = $mysqli->insert($sql);

echo $ret === true ? '添加用户成功' : '添加用户失败';

